package com.jar.exercise.多线程.AQS.LockSupport;

import java.util.concurrent.locks.LockSupport;

public class LockSupportTest {
	public static void main(String[] args) throws InterruptedException {
		Thread thread = new Thread(() -> test());
		thread.start();
		Thread.sleep(1000);
		System.out.println("wait另一个线程");
		Thread.sleep(3000);
		LockSupport.unpark(thread);
	}

	public static void test() {
		System.out.println("线程死了");
		LockSupport.park();
		System.out.println("线程活了");
	}
}
